1. Field of the Invention
The present invention relates to a technique for detecting blown-out highlights or blocked-up shadows in an image.
2. Description of Related Art
In image pickup apparatuses such as digital cameras, white balance control and exposure control are carried out. In order to perform such controls accurately, it is necessary to remove a blown-out highlight portion and a blocked-up shadow portion. For this reason, the blown-out highlight portion and the blocked-up shadow portion are detected.
In recent years, an increasing number of high performance cameras, such as a digital single-lens reflex camera, have a function of storing raw images as they are. In image processing apparatuses for processing raw images, white balance correction and exposure correction are carried out. To perform such corrections with high accuracy, it is necessary to remove a blown-out highlight portion and a blocked-up shadow portion. For this reason, the blown-out highlight portion and the blocked-up shadow portion are detected also in the image processing apparatuses.
The detection of blown-out highlights and blocked-up shadows is usually performed based on the brightness of pixels. However, the detection of blown-out highlights and blocked-up shadows in each pixel is undesirably time consuming. When blown-out highlights and blocked-up shadows are detected using hardware, there arises a problem of an increase in circuit size. Especially in the field of image pickup apparatuses, it is difficult to meet market needs for downsizing.
Japanese Unexamined Patent Application Publication No. 2005-109705 discloses a technique for solving the above-mentioned problems. According to the technique, an image is divided into a plurality of blocks, and blocks which include blown-out highlights or blocked-up shadows are detected based on average pixel values obtained for each block. In the case of obtaining correction values for the white balance correction, operation is performed on blocks other than the detected blocks including blown-out highlights or blocked-up shadows.
Specifically, according to the technique, the detection is carried out such that a block in which all the average pixel values of R value, G value, and B value are equal to or greater than a predetermined threshold (hereinafter referred to as “blown-out highlight threshold”) is detected as a blown-out highlight area, and a block in which all the average pixel values of R value, G value, and B value are equal to or smaller than a predetermined threshold (hereinafter referred to as “blocked-up shadow threshold”) is detected as a blocked-up shadow area.